<p id="notice"><%= notice %></p>

<p>Endereço de entrega</p>

<%= form_tag("/addresses/find_by_zip", :method => "get", :remote => true) do %>
  <%= label_tag(:zip, "CEP:") %>
  <%= text_field_tag(:zip) %>
  <%= submit_tag("Buscar endereço pelo CEP") %>
<% end %>


<%= form_for delivery_address, :url => "/purchases/set_address" do |f| %>
  <div class="field">
    <%= f.label :zip, 'CEP' %><br/>
    <%= f.text_field :zip %>
  </div>
  <div class="field">
    <%= f.label :street, 'Rua' %><br/>
    <%= f.text_field :street %>
  </div>
  <div class="field">
    <%= f.label :number, 'Numero' %><br/>
    <%= f.text_field :number %>
  </div>
  <div class="field">
    <%= f.label :complement, 'Complemento' %><br/>
    <%= f.text_field :complement %>
  </div>
  <div class="field">
    <%= f.label :district, 'Bairro' %><br/>
    <%= f.text_field :district %>
  </div>
  <div class="field">
    <%= f.label :city, 'Cidade' %><br/>
    <%= f.text_field :city %>
  </div>
  <div class="field">
    <%= f.label :state, 'Estado' %><br/>
    <%= f.text_field :state %>
  </div>
  <%= f.submit "Proximo" %>
<% end %>